import Mock from 'mockjs';

// export function getComCheckList(config){

//   getUserList:config => {
//     const { limit , page } = JSON.parse(config.body);
//     let mockList = List;
//     const userList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
//     return {
//       code: 200,
//       data: {
//         total: mockList.length,
//         userList: userList
//       }
//     }
//   }
//  console.log(config)
// }

//
let count = 100;
let List = [];
let fileInfoList =[];

for (let i = 0; i < count; i++) {
    List.push(Mock.mock({
        "mark|AAA-BBB": 1,
        "policyType|0-1": 1,
        "institution|1": ["广州营业部","杭州分公司","上海办事处"],
        'channel':'销售',
        "policyNo|1": ["2215878558","123123112"],
        "acceptNo|1": ["4415878558","123333333"],
        "accidentName|1": ["张三","李四",'刘邦'],
        "beInsuredName|1": ["张三","王五",'刘邦'],
        "contractName|1": ['中信保诚保险','中信保城广州营业部'],
        "taskRank|1":['1','2','3'],
        "taskType|1":['照会','照会回复'],
        "insuredDate|1": ["1992-12-12","1982-1-12","1991-06-12"],
        "acceptdate|1": ["1992-12-12","1982-1-12","1991-06-12"],
        "DealDate|1": ["1992-12-12","1982-1-12","1991-06-12"],
        "moreMark|1": ["单","多"],
        "groupNo|1": ["545634","234234"],
        "circulationRecord|1": ['535345','3453454','45345334'],
        "remarks|1": ['文字','备注信息'],
    }))
}

for (let i = 0; i < count; i++) {
    fileInfoList.push(Mock.mock({
        "acceptNo|1": ["4415878558","123333333"],
        "acceptdate|1": ["1992-12-12","1982-1-12","1991-06-12"],
        "dealStatus":"交查",
    }))
}



export default {
    getNewUnderwritList: (config) =>{
        const {policyNo,acceptNo,channel,taskRank,markNo,institution,acceptdate,pageSize,pageNumber} = JSON.parse(config.body);
        let mockList = List;
        const userList = mockList.filter((item, index) => index < pageSize * pageNumber && index >= pageSize * (pageNumber - 1))
        return {
            // code: 0,
            resultCode: '0',
            resultMsg: '数据返回成功。',
            data:{
                pageNumber: pageNumber,
                total: mockList.length,
                pageSize: pageSize,
                data: userList
            }
        }
    },

    getfileInfoList: (config) =>{
        const {acceptNo,evidenceNo,policyNo,pageSize,pageNumber} = JSON.parse(config.body);
        let mockList = fileInfoList;
        const userList = mockList.filter((item, index) => index < pageSize * pageNumber && index >= pageSize * (pageNumber - 1))
        console.log("bbbbbbb");
        console.log(userList);
        return {
            // code: 0,
            resultCode: '0',
            resultMsg: '数据返回成功。',
            data:{
                pageNumber: pageNumber,
                total: mockList.length,
                pageSize: pageSize,
                data: userList
            }
        }
    },
    
}